import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
import * as vscode from 'vscode';
export function deleteImage() {
    const homeDir = os.homedir();
    const imageDir = path.join(homeDir, '.image');
    
    if (fs.existsSync(imageDir)) {
        const files = fs.readdirSync(imageDir);
        
        for (const file of files) {
            const filePath = path.join(imageDir, file);
            const stat = fs.statSync(filePath);
            
            if (stat.isFile()) {
                fs.unlinkSync(filePath);
            } else if (stat.isDirectory()) {
                fs.rmdirSync(filePath, { recursive: true });
            }
        }
    }

    vscode.window.showInformationMessage('Image deleted');
}